
<div class="sidebar">
    <?php if(in_array($identity, array(1,2,3))){?>
    <div class="my-info">
        <div class="avatar"><img src="<?php echo session('avatar')?session('avatar'):'__UPLOAD_PATH__/shop/common/default_user_portrait.gif';?>"/><a href="<?php echo url('member/information/avatar');?>" title="修改头像">修改头像</a></div>
        <dl>
            <dt>
            <h3><a href="{:url('pcenter/index')}" target="_blank">进入个人中心</a></h3>
            </dt>
            <dd>
                本圈头衔：
                <?php echo memberLevelHtml($cm_info);?>
            </dd>
            <dd class="mt10">
                本圈经验：
                <div class="cm-exp">
                    <?php if($cm_info['cm_level'] == 16){?>
                    <p style="width: 100%;"> </p>
                    <i> <?php echo $cm_info['cm_exp'];?></i>
                    <?php }else{?>
                    <p style="width: <?php echo intval($cm_info['cm_nextexp']) != 0?sprintf('%.2f%%', intval($cm_info['cm_exp'])/intval($cm_info['cm_nextexp'])*100):0;?>"> </p>
                    <i> <?php echo $cm_info['cm_exp'].'/'.$cm_info['cm_nextexp'];?></i>
                    <?php }?>
                </div>
            </dd>
        </dl>
    </div>
    <?php }?>
    <!--公告与信息-->
    <div class="side-tab-nav">
        <ul class="tabs-nav">
            <li class="tabs-selected"><a href="javascript:void(0)">圈子公告</a></li>
            <li><a href="javascript:void(0)">圈子信息</a></li>
        </ul>
        <div class="sidebar-circle-notice tabs-panel">
            <p>
                <?php if($circle_info['circle_notice'] != ''){ echo $circle_info['circle_notice'];}else{?>
                <span class="no-notice"><i></i>暂无公告</span>
                <?php }?>
            </p>
        </div>
        <div class="sidebar-circle-info tabs-panel tabs-hide">
            <dl>
                <dt>所属分类：</dt>
                <dd>
                    <?php if($class_info['class_name'] != ''){ echo $class_info['class_name'];}else{echo '默认';}?>
                </dd>
            </dl>
            <dl>
                <dt>建立时间：</dt>
                <dd><?php echo @date('Y-m-d',$circle_info['circle_addtime']);?></dd>
            </dl>
            <dl>
                <dt>圈友数量：</dt>
                <dd><?php echo $circle_info['circle_mcount'];?> 人</dd>
            </dl>
            <dl>
                <dt>话题总数：</dt>
                <dd><?php echo $circle_info['circle_thcount'];?> 条</dd>
            </dl>
            <dl>
                <dt>圈主：</dt>
                <dd><a href="javascript:void(0)" class="master" title="<?php echo $creator['member_name'];?>"><i></i><?php echo $creator['member_name'];?></a></dd>
            </dl>
            <dl>
                <dt>管理：</dt>
                <dd>
                    <?php if(!empty($manager_list)){?>
                    <?php foreach (($manager_list) as $val){?>
                    <a href="javascript:void(0)" class="moderator" title="<?php echo $val['member_name'];?>"><i></i><?php echo $val['member_name'];?></a>
                    <?php }?>
                    <?php }else{?>
                    <span><?php echo '暂无';?></span>
                    <?php }?>
                </dd>
            </dl>
        </div>
    </div>
    <!--会员情况-->
    <div class="side-tab-nav">
        <ul class="tabs-nav">
            <li class="tabs-selected"><a href="javascript:void(0)">明星圈友</a></li>
            <li><a href="javascript:void(0)">最新加入</a></li>
        </ul>
        <div class="sidebar-circle-member tabs-panel">
            <?php if(!empty($star_member)){?>
            <?php foreach(($star_member) as $val){?>
            <dl>
                <dt class="member-name"><a href="javascript:void(0)"><?php echo $val['member_name'];?></a></dt>
                <dd class="member-avatar-s"><img src="<?php echo $val['member_avatar'];?>" /><em></em></dd>
                <dd class="theme-num" title="话题数">(<b><?php echo $val['cm_thcount'];?></b>)</dd>
            </dl>
            <?php }?>
            <?php }else{?>
            <p> <span class="no-member"><i></i>暂无圈友</span> </p>
            <?php }?>
        </div>
        <div class="sidebar-circle-member tabs-panel tabs-hide">
            <?php if(!empty($newest_member)){?>
            <?php foreach(($newest_member) as $val){?>
            <dl>
                <dt class="member-name"><a  href="javascript:void(0)"><?php echo $val['member_name'];?></a></dt>
                <dd class="member-avatar-s"><img src="<?php echo $val['member_avatar'];?>" /></dd>
                <dd class="theme-num" title="话题数">(<b><?php echo $val['cm_thcount'];?></b>)</dd>
            </dl>
            <?php }?>
            <?php }?>
        </div>
    </div>
    <!--友情链接-->
    <?php if(!empty($friendship_list)){?>
    <div class="sidebar-box">
        <div class="title">
            <h3>友情圈子</h3>
        </div>
        <div class="content">
            <ul class="sidebar-circle-links">
                <?php foreach (($friendship_list) as $val){?>
                <li><span class="thumb size32"><i></i><a href="<?php echo url('group/index',array('c_id'=>$val['friendship_id']));?>" title="<?php echo $val['friendship_name'];?>"><img src="<?php echo circleLogo($val['friendship_id']);?>" /></a></span></li>
                <?php }?>
            </ul>
        </div>
    </div>
    <?php }?>
</div>
<script>
    $(function(){
        //帖子列表隔行变色
        $(".group-theme-list li:odd").css("background-color","#F8F9FA");
        $(".group-theme-list li:even").css("background-color","#FCFCFC");

//侧边栏tab切换
        $(".tabs-nav > li > a").click(function(e) {
            if (e.target == this) {
                var tabs = $(this).parent().parent().children("li");
                var panels = $(this).parent().parent().parent().children(".tabs-panel");
                var index = $.inArray(this, $(this).parent().parent().find("a"));
                if (panels.eq(index)[0]) {
                    tabs.removeClass("tabs-selected")
                            .eq(index).addClass("tabs-selected");
                    panels.addClass("tabs-hide")
                            .eq(index).removeClass("tabs-hide");
                }
            }
        });
    });
</script>
